﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ODataRegression.Framework.Core.TestOM;
using ODataRegression.Framework.Core.MetaDataOM;
using ODataRegression.Framework.Core.Shared;
using ODataTestFrameworkCore.shared;

namespace ODataRegression.Framework.Core.Factories
{
    public class ODataCountTestFactory : ODataTestFactoryBase
    {
     
        public override List<ODataTest> CreateTestList()
        {
            //List<ODataTest>ha ah a testList = new List<ODataTest>();
            EntityBaseURL = entitySet.URL;
            FinalQueryURL = EntityBaseURL + "/$count";
            //string queryURL;

            testName = ODataTestNames.Count;
            testTile = "Verify the $Count is working for selected collection";
            if ( this.ISAvtiveTest)
            {
                
                FinalQueryURL = URLMappers.ApplyConfigMappingActions(FinalQueryURL);

               // testList.Add(new ODataTest(serviceRoot, this.ServiceName, entitySet.CollectionName, entitySet.Entity.Name,
                  //  testName, testTile, FinalQueryURL, UriResultType.Feed, null, this.testConfig));
                base.CreateTestList();
            }
            
            return testList;
        }

        public ODataCountTestFactory(string serviceRoot, string ServiceBusinessName, ODataEntitySet entityset )
            :base( serviceRoot,  ServiceBusinessName,  entityset)
        {
            this.entitySet = entityset;
            this.ServiceName = ServiceBusinessName;
            this.serviceRoot = serviceRoot;
            this.verificationToken = null;
            // HTTPGetResult getResult = null;
            
        }
    }
}
